<template>
  <div>
    <div class="header">
      <div class="logo">天猫商城</div>
      <div class="nav">
        <div v-for="item in routes" :key="item.path"
             :class="{active: $route.path === item.path}" class="nav-item"
             @click="$router.push(item.path)">{{ item.text }}
        </div>
      </div>
      <div class="profile">个人信息</div>
    </div>
    <router-view/>
  </div>
</template>

<script>
export default {
  name: "index",
  data() {
    return {
      routes: [
        {path: '/home', text: '首页'},
      ]
    }
  },
}
</script>

<style scoped lang="scss">
.active {
  color: #007bff;
  font-weight: bold;
  font-size: 18px;
  font-family: '微软雅黑', sans-serif;
}

.header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background-color: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
}

.logo {
  font-size: 1.5em;
  font-weight: bold;
}

.nav {
  display: flex;
}

.nav-item {
  margin: 0 15px;
  cursor: pointer;
  transition: color 0.3s;

  &:hover {
    color: #007bff;
  }
}

.profile {
  cursor: pointer;
}
</style>
